package com.android.canvasproject.model.entity;

import java.util.Date;

public class User extends GenericEntity {

	private static final long serialVersionUID = -5009775290874550331L;

	private Integer id;

	private String username;

	private String password;

	private Date lastAccessed;

	private Integer person;

	public static class UserDao {
		public static final String TB_USER = "USER";

		public static final String[] COLS_USER = new String[] { "_id",
				"username", "password", "last_accessed", "id_person", "id_ics",
				"creation_date", "last_sync", "last_notification",
				"local_creation", "is_synchronized" };

		public static final String DB_CREATE_USER = "CREATE TABLE IF NOT EXISTS USER (_id INTEGER PRIMARY KEY, username VARCHAR(60) UNIQUE NOT NULL, password TEXT NOT NULL, last_accessed DATETIME DEFAULT CURRENT_TIMESTAMP, id_person INTEGER NOT NULL, id_ics BIGINT UNIQUE, creation_date DATETIME DEFAULT CURRENT_TIMESTAMP, last_sync TIMESTAMP NULL, last_notification TIMESTAMP NULL, local_creation INT DEFAULT 0, is_synchronized INT DEFAULT 0, CONSTRAINT fk_user_person FOREIGN KEY (id_person) REFERENCES PERSON (_id));";
	}

	public User() {
		super();
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Date getLastAccessed() {
		return lastAccessed;
	}

	public void setLastAccessed(Date lastAccessed) {
		this.lastAccessed = lastAccessed;
	}

	public Integer getPerson() {
		return person;
	}

	public void setPerson(Integer person) {
		this.person = person;
	}
}